package com.lihh.rocket5.demo;

import java.util.HashMap;
import java.util.Map;

class BrokerAddrInfo {
  private String clusterName;
  private String brokerAddr;
  
  public BrokerAddrInfo(String clusterName, String brokerAddr) {
    this.clusterName = clusterName;
    this.brokerAddr = brokerAddr;
  }
  
  @Override
  public int hashCode() {
    return 1;
  }
  
  @Override
  public boolean equals(Object obj) {
    return true;
  }
  
  @Override
  public String toString() {
    return super.toString();
  }
}

public class Demo001 {
  
  static Map map = new HashMap<BrokerAddrInfo, String>();
  
  public static void main(String[] args) {
    BrokerAddrInfo brokerAddrInfo = new BrokerAddrInfo("1", "2");
    map.put(brokerAddrInfo, "1");
    
    BrokerAddrInfo brokerAddrInfo1 = new BrokerAddrInfo("1", "2");
    System.out.println(map.get(brokerAddrInfo1));
  }
}
